/**
 * 
 */
package cn.softTank.BpelModelImpl;

import org.dom4j.Element;

import cn.softTank.BpelModel.Correlations;
import cn.softTank.BpelModel.PartnerActivity;

/**
 * @author Yuzone (smartzxy@gmail.com)
 *
 */
public abstract class PartnerActivityImpl extends ActivityImpl implements
		PartnerActivity {

	private String operation;
	private String partnerLink;
	private String portType;
	private Correlations correlations;
	
	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.PartnerActivity#getCorrelations()
	 */
	@Override
	public Correlations getCorrelations() {
		return correlations;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.PartnerActivity#getOperation()
	 */
	@Override
	public String getOperation() {
		return operation;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.PartnerActivity#getPartnerLink()
	 */
	@Override
	public String getPartnerLink() {
		return partnerLink;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.PartnerActivity#getPortType()
	 */
	@Override
	public String getPortType() {
		return portType;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.PartnerActivity#setCorrelations(cn.softTank.BpelModel.Correlations)
	 */
	@Override
	public void setCorrelations(Correlations value) {
		this.correlations=value;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.PartnerActivity#setOperation(java.lang.String)
	 */
	@Override
	public void setOperation(String value) {
		operation=value;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.PartnerActivity#setPartnerLink(java.lang.String)
	 */
	@Override
	public void setPartnerLink(String value) {
		partnerLink=value;
	}

	/* (non-Javadoc)
	 * @see cn.softTank.BpelModel.PartnerActivity#setPortType(java.lang.String)
	 */
	@Override
	public void setPortType(String value) {
		portType=value;
	}
	
	@Override
	public Element toElement(){
		node=super.toElement();
		if(partnerLink!=null)
			node.addAttribute("partnerLink", partnerLink);
		if(portType!=null)
			node.addAttribute("portType", portType);
		if(operation!=null)
			node.addAttribute("operation", operation);
		if(correlations!=null)
			node.add(correlations.toElement());
		return node;
	}
}
